﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DesignPatternDemoCApp.Behavioral.ObserverPattern
{
    /// <summary>
    /// 具体观察者
    /// </summary>
    public class User : AbstractObserver
    {
        private string message;
        public string Name { get; set; }

        public override void update(string message)
        {
            this.message = message;
            read();
        }

        public void read()
        {
            Console.WriteLine(Name + " 收到推送消息： " + message);
        }
    }
}
